<!-- Dom模板 -->
<template>
  <div>
    <!-- Dom内容 -->
    <el-pagination
      background
      layout="prev, pager, next"
      :total="list.length"
      @current-change="handleCurrentChange"
      :current-page.sync="strip"
      :pager-count="7"
      :page-size="page"
    >
    </el-pagination>
  </div>
</template>

<script>
// import a from './a'; // 引入组件
export default {
  components: {},
  props: ["list", "tiao", "ye"],
  name: "",
  data() {
    return {
      msg: "测试",
      list1: [],
      page: "", //每页条数
      strip: "", //当前页
    };
  },
  // 生命周期 - 创建完成（访问当前this实例）
  created() {
    this.page = this.tiao;
    this.strip = this.ye;
  },
  // 生命周期 - 挂载完成（访问DOM元素）
  mounted() {
    // console.log(this.page);
    // console.log(this.strip);
  },
  // Vue方法定义
  methods: {
    handleCurrentChange(val) {
      this.strip = val;
      this.list1 = this.list.slice(
        Number(this.strip - 1) * this.tiao,
        this.strip * this.tiao
      );
      this.$emit("paging", val);
    },
  },
};
</script>

<style scoped>
/* @import url(''); 引入css类 */
</style>
